<?php

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use app\modules\cruise\models\Room;

//获取所有房间类型

$room = Room::find()->where(['status'=>1])->all();

$room_arr = [];

foreach($room as $r){
    $room_arr[$r->id] = $r->name.' '.$r->code;
}

$num_arr = [1=>1,2=>2,3=>3,4=>4,5=>5,6=>6,7=>7,8=>8];

?>

<div class="room-use-form">

    <?php $form = ActiveForm::begin([
                                     'options' => ['enctype' => 'multipart/form-data',],
                                     'layout' => 'horizontal',
                                     'fieldConfig' => [
                                        'template' => "{label}\n{beginWrapper}\n{input}\n{hint}\n{error}\n{endWrapper}",
                                        'horizontalCssClasses' => [
                                            'label' => 'col-sm-2',
                                            'wrapper' => 'col-sm-7',
                                            'error' => '',
                                        ],
                                     ],
                                ]); ?>

    <?= $form->field($model, 'room_id')->dropDownList($room_arr) ?>

    <?= $form->field($model, 'num')->dropDownList($num_arr) ?>

    <?= $form->field($model, 'remark')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'ord')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'status')->inline(true)->radioList(\Yii::$app->params['status']) ?>

    <div class="form-group text-center">
        <?= Html::submitButton('保存', ['class' => 'btn btn-success']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
